package org.iks.store.business.vo.session;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.iks.common.constant.Constant;
import org.iks.common.pojo.message.ChatMessage;
import org.springframework.lang.Nullable;

import java.util.Date;

/**
 * Author kzou
 * Date 2024/2/14
 * Description: 会话列表实体类
 */
@Data
public class SessionMessageVo {

    @Schema(description = "会话ID")
    private Integer sessionId;

    @Schema(description = "会话名称")
    private String sessionName;

    @Schema(description = "会话创建者账号")
    private String creatorAccount;

    @Schema(description = "会话创建时间")
    @JsonFormat(pattern = Constant.DATE_TIME_FORMAT)
    private Date createTime;

    @Schema(description = "会话头像")
    private String avatar;

    @Schema(description = "最新的一条信息", nullable = true)
    @Nullable
    private ChatMessage latestMessage;

    @Schema(description = "未读消息数量")
    private Integer unReadCount;

    @Schema(description = "用户账号")
    private String userAccount;

}
